<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content=" initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 方法1 */
        /* .father{
            overflow: hidden;
        } */
        .box {
            width: 200px;
            height: 200px;
            background-color: aquamarine;
            float: right;
        }

        .box1 {
            width: 300px;
            height: 300px;
            background-color: red;
        }

        /* 方法2 */
        /* .clear{
            clear: both;
        } */

        /* 方法3  */
        /* .clearfix::after{
            content: "1";
            display: block;
            height: 0px;
            clear: both; */
        /* background-color: rebeccapurple; */
        /* 元素不可见： */
        /* visibility: hidden;
        } */


        /* 方法4 */
        .clearfix:before,
        .clearfix:after {
            content: "";
            display: table;
        }

        .clearfix:after {
            clear: both;
        }

        /* .clearfix {
            *zoom: 1;
        } */
    </style>
</head>

<body>
    <div class="father clearfix">
        <div class="box"></div>
        <!-- <div class="clear">额外标签法</div> -->
    </div>
    <div class="box1">
</body>

</html>